<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include/header :: header('修改密码')"></head>
<body>
<div id="dpLTE" class="container-fluid" v-cloak>
    <table class="form" id="form">
        <tr>
            <td class="formTitle">姓名</td>
            <td class="formValue">
                <input id="realName" readonly type="text" class="form-control" v-model="user.realName"/>
            </td>
        </tr>
        <tr>
            <td class="formTitle">帐户</td>
            <td class="formValue">
                <input id="account" readonly type="text" class="form-control" v-model="user.account"/>
            </td>
        </tr>
        <tr>
            <td class="formTitle">原密码<font face="宋体">*</font></td>
            <td class="formValue">
                <input type="password" class="form-control" placeholder="原密码"  v-model="user.password"  isvalid="yes" checkexpession="NotNull">
            </td>
        </tr>
        <tr>
            <td class="formTitle">新密码<font face="宋体">*</font></td>
            <td class="formValue">
                <input type="password" class="form-control" placeholder="新密码"  v-model="user.newPassword"  isvalid="yes" checkexpession="NotNull">
            </td>
        </tr>
    </table>
</div>
<div th:include="include/footer :: footer"></div>
<script type="text/javascript">

    var vm = new Vue({
        el: '#dpLTE',
        data: function(){
            return {
                user: {
                    realName:'',
                    account:'',
                    password:'',
                    newPassword:''
                }
            }
        },
        mounted: function () {
//            this.user.account=request('account');
//            this.user.realName=request('realName');
        },
        methods: {
            acceptClick: function () {
                if (!$('#form').Validform()) {
                    return false;
                }
                var data = "password=" + vm.user.password + "&newPassword=" + vm.user.newPassword;
                $.ajax({
                    type: "POST",
                    url: "/sys/user/updatePswd?_" + $.now(),
                    data: data,
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 0) {
                            //layer.close(index);
                            dialogMsg(result.msg, 'success');
                            //location.reload();
                            dialogClose();
                        } else {
                            dialogAlert(result.msg, 'error');
                        }
                    }
                });
            }
        }
    })
</script>
</body>
</html>